package elevatronic.view.left.floors;

import java.util.ArrayList;
import java.util.List;

import elevatronic.models.Floor;
import elevatronic.view.ImageView;
import elevatronic.view.MPanel;
import elevatronic.view.left.ButtonView;

public class FloorPanel extends MPanel{
	private static final long serialVersionUID = -5343455109748751765L;
	public static final int FLOOR_PANEL_WIDTH=32;
	public static final int FLOOR_PANEL_HEIGHT=50;
	
	

	// view of the button up
	private ButtonView buttonUp;
	public ButtonView getButtonUp() {
		return buttonUp;
	}
	public void setButtonUp(ButtonView buttonUp) {
		this.buttonUp = buttonUp;
	}
	
	// view of the button down
	private ButtonView buttonDown;
	public ButtonView getButtonDown() {
		return buttonDown;
	}
	public void setButtonDown(ButtonView buttonDown) {
		this.buttonDown = buttonDown;
	}
	
	
	
	
	//List of images
	public List<ImageView> getImages() {
		List<ImageView> retour= new ArrayList<ImageView>();
		retour.add(getImagePanel());
		retour.add(getButtonUp().getImageButton());
		retour.add(getButtonDown().getImageButton());
		return retour;
	}

	/* Constructor
	 * @param wdth width of the panel
	 * @param hght height of the panel
	 */
	public FloorPanel(int wdth,int hght, Floor floor){
		super(wdth,hght);
	    ImageView imagePanel=new ImageView("buttonFloor",0,0,wdth,hght);
	    imagePanel.setVisible(true);
	    setImagePanel(imagePanel);
	    setButtonUp(new ButtonView(floor.getButtonUp(),"buttonUpFloor",9,7,13,13));
	    setButtonDown(new ButtonView(floor.getButtonDown(),"buttonDownFloor",10,29,12,13));
	    
	}
	

	
	//iteration of the floor panels
	public void update(int step){
		super.update(step);
		getButtonUp().update(step);
		getButtonDown().update(step);
	}
	


}
